﻿namespace Md.Api.Model;
/// <summary>
/// API统一响应实体类
/// </summary>
public class ResponseMessageModel
{
    /// <summary>
    /// 构造方法
    /// </summary>
    public ResponseMessageModel()
    {
        Code = "200";
        IsSuccess = true;
        Msg = "操作成功";
    }

    /// <summary>
    /// 商户CODE
    /// </summary>
    public string? MerchantId
    {
        get; set;
    }

    /// <summary>
    /// 数据
    /// </summary>
    public object? Data
    {
        get; set;
    }

    /// <summary>
    /// 列表数据
    /// </summary>
    public object? Rows
    {
        get;set;
    }

    /// <summary>
    /// 消息
    /// </summary>
    public string Msg
    {
        get; set;
    }

    /// <summary>
    /// 编码
    /// </summary>
    public string Code
    {
        get; set;
    }

    /// <summary>
    /// 是否成功
    /// </summary>
    public bool IsSuccess
    {
        get; set;
    }

    /// <summary>
    /// 状态码
    /// 200=成功
    /// 500=失败
    /// </summary>
    public int Status
    {
        get
        {
            return IsSuccess ? 200 : 500;
        }
    }
}

